﻿using Prism.Commands;
using Prism.Ioc;
using Prism.Mvvm;
using Prism.Regions;
using System;
using WpfExamples.Views;

namespace WpfExamples.ViewModels
{
    public class MainWindowViewModel : BindableBase
    {
        private string _title = "Prism Application";
        public string Title
        {
            get { return _title; }
            set { SetProperty(ref _title, value); }
        }
        public DelegateCommand<string> MainMenuCommandClick { get; private set; }
        private readonly IRegionManager RGM;
        public MainWindowViewModel(IRegionManager regionManager)
        {
            RGM = regionManager;
            MainMenuCommandClick = new DelegateCommand<string>(MainMenuClick);
        }

        private void MainMenuClick(string obj)
        {
            RGM.Regions["ContentRegion"].RequestNavigate(obj);
            
        }

    }
}
